<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>博客</title>
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
    <link rel="stylesheet" href="{{url_for('static', filename='css/main.css')}}">
    {% block css %}

    {% endblock %}
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://cdn.bootcss.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
</head>
<body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
        <div class="container">
            <div class="navbar-brand">Blog</div>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                  <li class="nav-item active">
                    <a class="nav-link" href="{{url_for('main.index')}}">首页 <span class="sr-only">(current)</span></a>
                  </li>
                  <li class="nav-item active">
                   <a class="nav-link" href="{{url_for('main.index')}}">博客 <span class="sr-only">(current)</span></a>
                  </li>
                </ul>
                <form class="form-inline">
                  <input class="form-control mr-sm-2" type="search" placeholder="关键字搜索" aria-label="Search">
                  <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
                </form>
                <div class="navbar-login-btn">
                    {% if current_user.is_authenticated %}
                        <div class="dropdown">
                          <span class="dropdown-toggle text-light username-btn" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            {{current_user.username}}
                          </span>
                          <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
                              <a class="dropdown-item" href="{{url_for('category.list')}}">管理中心</a>
                              <a class="dropdown-item" href="{{url_for('auth.logout')}}">退出登录</a>
                          </div>
                        </div>
                    {% else %}
                        <a href="{{url_for('auth.login')}}" class="text-success">登录</a>
                        <a href="{{url_for('auth.register')}}" class="text-success">注册</a>
                    {% endif %}
                </div>
            </div>
        </div>
    </nav>
    {% block content %}
    {% endblock %}
</body>
</html>